//传输用户名
const user = {
    state: null != window.sessionStorage.getItem('user') ? JSON.parse(window.sessionStorage.getItem('user')) :

        {
            user: {
                name: '',
                password: ''
            }
        },

    getters: {
        getUser(state) {
            return state.user;
        }
    },

    mutations: {
        updateUser(state, user) {
            state.user = user;
        }
    },
    actions: {
        asyncUpdataUser(content, user) {
            content.commit('updateUser', user)
        }
    },
}

export default user;